import type { CSSProperties } from "vue";
declare global {
  declare interface Fn<T = any> {
    (...arg: T[]): T;
  }
  declare type Nullable<T> = T | null;
  declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>;
  declare type Recordable<T = any, K = string> = Record<
    K extends null | undefined ? string : K,
    T
  >;
  declare type ComponentRef<T> = InstanceType<T>;
  declare type LocaleType = "zh-CN" | "en";
  declare type AxiosHeaders =
    | "application/json"
    | "application/x-www-form-urlencoded"
    | "multipart/form-data";
  declare type AxiosMethod =
    | "OPTIONS"
    | "GET"
    | "HEAD"
    | "POST"
    | "PUT"
    | "DELETE"
    | "TRACE"
    | "CONNECT"
    | undefined;
  declare type AxiosResponseType =
    | "arraybuffer"
    | "blob"
    | "document"
    | "json"
    | "text"
    | "stream";
  declare interface listQueryFace {
    current: number;
    pageSize: number;
  }
  declare function isNaN(number: number | string): boolean;

  declare type UniloadingFace = "more" | "loading" | "noMore";
  declare interface AxiosConfig {
    params?: any;
    data?: any;
    url?: string;
    method?: AxiosMethod;
    headersType?: string;
    responseType?: AxiosResponseType;
    noToken?: boolean;
  }
  declare interface IResponse<T = any> {
    code: number;
    data: T extends any ? T : T & any;
    message: string;
  }
  declare interface WxGetPhoneNumberInfo<T = any> {
    currentTarget: any;
    detail: {
      code: string;
      encryptedData: string;
      errMsg: string;
      iv: string;
    };
    type: string;
  }

  // 列表的返回结果，
  declare interface IResponseList<T = any> {
    data: {
      list: T extends any ? T : T & any;
      total: number;
      records: T extends any ? T : T & any;
    };
    dataSize: number;
    success: boolean;
    extra?: string;
    description?: string;
    errorCode?: number;
  }
  declare type SetOptional<T, K extends keyof T> = Simplify<
    Partial<Pick<T, K>> & Pick<T, Exclude<keyof T, K>>
  >;
}
